package com.ruoyi.enterprise.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.enterprise.mapper.EContractRecordMapper;
import com.ruoyi.common.core.domain.e_enterprise.EContractRecord;
import com.ruoyi.enterprise.service.IEContractRecordService;

/**
 * 合同签订记录Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class EContractRecordServiceImpl implements IEContractRecordService 
{
    @Autowired
    private EContractRecordMapper eContractRecordMapper;

    /**
     * 查询合同签订记录
     * 
     * @param id 合同签订记录主键
     * @return 合同签订记录
     */
    @Override
    public EContractRecord selectEContractRecordById(Long id)
    {
        return eContractRecordMapper.selectEContractRecordById(id);
    }

    /**
     * 查询合同签订记录列表
     * 
     * @param eContractRecord 合同签订记录
     * @return 合同签订记录
     */
    @Override
    public List<EContractRecord> selectEContractRecordList(EContractRecord eContractRecord)
    {
        return eContractRecordMapper.selectEContractRecordList(eContractRecord);
    }

    /**
     * 新增合同签订记录
     * 
     * @param eContractRecord 合同签订记录
     * @return 结果
     */
    @Override
    public int insertEContractRecord(EContractRecord eContractRecord)
    {
        eContractRecord.setCreateTime(DateUtils.getNowDate());
        return eContractRecordMapper.insertEContractRecord(eContractRecord);
    }

    /**
     * 修改合同签订记录
     * 
     * @param eContractRecord 合同签订记录
     * @return 结果
     */
    @Override
    public int updateEContractRecord(EContractRecord eContractRecord)
    {
        eContractRecord.setUpdateTime(DateUtils.getNowDate());
        return eContractRecordMapper.updateEContractRecord(eContractRecord);
    }

    /**
     * 批量删除合同签订记录
     * 
     * @param ids 需要删除的合同签订记录主键
     * @return 结果
     */
    @Override
    public int deleteEContractRecordByIds(Long[] ids)
    {
        return eContractRecordMapper.deleteEContractRecordByIds(ids);
    }

    /**
     * 删除合同签订记录信息
     * 
     * @param id 合同签订记录主键
     * @return 结果
     */
    @Override
    public int deleteEContractRecordById(Long id)
    {
        return eContractRecordMapper.deleteEContractRecordById(id);
    }
}
